﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" mc:Ignorable="d"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	xmlns:GBAExtentionLib="clr-namespace:GBAExtentionLib">
    <!-- 应该在此定义资源字典条目。-->
    <Style TargetType="GBAExtentionLib:DirectoryWatcher">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <!--<phone:PhoneApplicationPage SupportedOrientations="PortraitOrLandscape" Orientation="LandscapeLeft" Width="480" Height="800">-->
                    <Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Background="Black">
                        <Grid.Resources>
                            <Style x:Key="RefreshButtonStyle" TargetType="Button">
                                <Setter Property="Background" Value="Transparent"/>
                                <Setter Property="BorderBrush" Value="White"/>
                                <Setter Property="Foreground" Value="White"/>
                                <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
                                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
                                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
                                <Setter Property="Padding" Value="10,3,10,5"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <Grid Background="Transparent">
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal"/>
                                                        <VisualState x:Name="MouseOver"/>
                                                        <VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Black"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="White"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="White"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Gray"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="DarkGray"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="{StaticResource PhoneTouchTargetOverhang}">
                                                    <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                                </Border>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Button x:Name="RefreshButton" Style="{StaticResource RefreshButtonStyle}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Image Grid.Column="0" Source="/GBAExtentionLib;component/Images/Refresh.png" Width="24" Height="24"/>
                                <TextBlock Grid.Column="1" Text="刷新" FontSize="24"/>
                            </Grid>
                        </Button>
                        <Grid Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" Source="/GBAExtentionLib;component/Images/Storage.png" Width="32" Height="32"/>
                            <TextBlock Grid.Column="1" x:Name="CurrentFolderText" Foreground="White" TextTrimming="WordEllipsis" FontSize="32" Margin="12"/>
                        </Grid>
                        <ListBox toolkit:TiltEffect.IsTiltEnabled="True" Margin="12,0" Grid.Row="2" x:Name="FileList">
                        </ListBox>
                    </Grid>
                    <!--</phone:PhoneApplicationPage>-->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>